﻿using AllIsWell.Services.Infrastructure;
using AllIsWell.Tests.TestData;
using NUnit.Framework;

namespace AllIsWell.Services.Tests
{
    [TestFixture]
    class WhatServiceTests : AllIsWellServiceTestBase
    {
        private IWhatService _whatService;

        [SetUp]
        public void SetUp()
        {
            _whatService = new WhatService(UnitOfWorkMock.Object);
        }

        [Test]
        public void GetWhatShouldReturnMatchingWhatIdFromRepository()
        {
            var expectedWhat = WhatSeed.GetWhat(1, 1);
            WhatRepositoryMock.Setup(repo => repo.GetWhat(1)).Returns(expectedWhat);

            var actualWhat = _whatService.GetWhat(1);

            Assert.AreEqual(expectedWhat, actualWhat);
        }        
    }
}